include(PurCCommon)

set(FS_LIBRARY_TYPE SHARED)

set(FS_PUBLIC_HEADERS
)

set(FS_SOURCES
    file.c
)

set(FS_PRIVATE_INCLUDE_DIRECTORIES
    "${CMAKE_BINARY_DIR}"
    "${GLIB_INCLUDE_DIRS}"
    "${FORWARDING_HEADERS_DIR}"
    "${PURC_DIR}"
    "${PurC_DERIVED_SOURCES_DIR}"
    "${PURC_DIR}/include"
)

set(FS_LIBRARIES
    ${CMAKE_DL_LIBS}
)

link_directories (${CMAKE_BINARY_DIR}/Source/PurC)
list(APPEND FS_LIBRARIES PurC::PurC)

PURC_FRAMEWORK_DECLARE(FS)
PURC_INCLUDE_CONFIG_FILES_IF_EXISTS()

set_target_properties(FS PROPERTIES OUTPUT_NAME "purc-dvobj-FS")
set_target_properties(FS PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")

PURC_WRAP_SOURCELIST(${FS_SOURCES})
PURC_FRAMEWORK(FS)

install(TARGETS FS DESTINATION "${LIB_INSTALL_DIR}/purc-${PURC_API_VERSION}")

if (MSVC)
    set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SUBSYSTEM:WINDOWS")
    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS")
endif ()
